home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 3 / Cream of the Crop 3.iso / utility / mu17_ext.zip / EXAMPATC.A < prev    next >
Text File  |  1994-03-07  |  1KB  |  63 lines

  1. ; patches Examine() so the fileinfoblock has "standard" protection bits...
  2.  
  3.     INCLUDE "exec/memory.i"
  4.  
  5. JLIB    MACRO
  6.     XREF    _LVO\1
  7.     jsr    _LVO\1(a6)
  8.     ENDM
  9.  
  10. _LVOExamine    EQU    -102
  11.  
  12.     SECTION code,code
  13.  
  14.     movem.l    a4-a5,-(sp)
  15.     move.l    (4).w,a6
  16.     lea    dosname(pc),a1
  17.     moveq    #37,d0
  18.     JLIB    OpenLibrary
  19.     move.l    d0,a5
  20.     beq    quit
  21.     moveq    #(end-start),d0
  22.     move.l    #MEMF_PUBLIC!MEMF_CLEAR,d1
  23.     JLIB    AllocMem
  24.     move.l    d0,a4
  25.     bne    gotmem
  26.     moveq    #103,d1
  27.     bra    qfault
  28. gotmem:    move.l    a4,a1
  29.     lea    start(pc),a0
  30.     moveq    #(end-start),d0
  31.     JLIB    CopyMem
  32.     move.l    -100(a5),2(a4)
  33.     move.l    a4,-100(a5)
  34.     move.l    #patched,d1
  35.     exg    a5,a6
  36.     JLIB    PutStr
  37.     exg    a5,a6
  38.     bra    qdos
  39. qfault:    move.l    #notpatched,d2
  40.     exg    a5,a6
  41.     JLIB    PrintFault
  42.     exg    a5,a6
  43. qdos:    move.l    a5,a1
  44.     JLIB    CloseLibrary
  45. quit:    movem.l    (sp)+,a4-a5
  46.     rts
  47.  
  48. start:    jsr    $F80000        ; guru/reset if we've been bad
  49.     exg    d2,a0
  50.     andi.l    #$00FF,116(a0)
  51.     exg    d2,a0
  52.     rts
  53.     dc.b    0,"$VER: ExamPatch 1.0 (6.12.93)",0
  54.     dc.b    "Don't kill me - I just fix MultiUserFileSystem!",0
  55.     ds.l    0
  56. end:
  57.  
  58. dosname:    dc.b    "dos.library",0
  59. notpatched:    dc.b    "Examine() not patched",0
  60. patched:    dc.b    "Examine() patched successfully.",10,0
  61.  
  62.     END
  63.